#include <iostream>
#include <string>

using namespace std;

/* 类模板技术和数值型模板参数 */
template
< int N >
class Sum
{
public:
    static const int VALUE = Sum<N-1>::VALUE + N;
};

/* 类的完全特化 */
template
< >
class Sum< 1 >
{
public:
    static const int VALUE = 1;
};

int sum_value_mode_test(void)
{
    cout << "1 + 2 + 3 + ... + 10 = " << Sum<10>::VALUE << endl;
    cout << "1 + 2 + 3 + ... + 100 = " << Sum<100>::VALUE << endl;
}
